package com.knowledgegraph.zhongyao.service.impl;

import java.util.List;
import java.util.UUID;

import com.knowledgegraph.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.knowledgegraph.zhongyao.mapper.PrescriptiontypeMapper;
import com.knowledgegraph.zhongyao.domain.Prescriptiontype;
import com.knowledgegraph.zhongyao.service.IPrescriptiontypeService;

/**
 * prescriptiontypeService业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-03
 */
@Service
public class PrescriptiontypeServiceImpl implements IPrescriptiontypeService 
{
    @Autowired
    private PrescriptiontypeMapper prescriptiontypeMapper;

    /**
     * 查询prescriptiontype
     * 
     * @param prescriptionkey prescriptiontype主键
     * @return prescriptiontype
     */
    @Override
    public Prescriptiontype selectPrescriptiontypeByPrescriptionkey(String prescriptionkey)
    {
        return prescriptiontypeMapper.selectPrescriptiontypeByPrescriptionkey(prescriptionkey);
    }

    /**
     * 查询prescriptiontype列表
     * 
     * @param prescriptiontype prescriptiontype
     * @return prescriptiontype
     */
    @Override
    public List<Prescriptiontype> selectPrescriptiontypeList(Prescriptiontype prescriptiontype)
    {
        return prescriptiontypeMapper.selectPrescriptiontypeList(prescriptiontype);
    }

    /**
     * 新增prescriptiontype
     * 
     * @param prescriptiontype prescriptiontype
     * @return 结果
     */
    @Override
    public int insertPrescriptiontype(Prescriptiontype prescriptiontype)
    {
        prescriptiontype.setPrescriptionkey(UUID.randomUUID().toString());
        prescriptiontype.setCreateTime(DateUtils.getNowDate());
        return prescriptiontypeMapper.insertPrescriptiontype(prescriptiontype);
    }

    /**
     * 修改prescriptiontype
     * 
     * @param prescriptiontype prescriptiontype
     * @return 结果
     */
    @Override
    public int updatePrescriptiontype(Prescriptiontype prescriptiontype)
    {
        prescriptiontype.setUpdateTime(DateUtils.getNowDate());
        return prescriptiontypeMapper.updatePrescriptiontype(prescriptiontype);
    }

    /**
     * 批量删除prescriptiontype
     * 
     * @param prescriptionkeys 需要删除的prescriptiontype主键
     * @return 结果
     */
    @Override
    public int deletePrescriptiontypeByPrescriptionkeys(String[] prescriptionkeys)
    {
        return prescriptiontypeMapper.deletePrescriptiontypeByPrescriptionkeys(prescriptionkeys);
    }

    /**
     * 删除prescriptiontype信息
     * 
     * @param prescriptionkey prescriptiontype主键
     * @return 结果
     */
    @Override
    public int deletePrescriptiontypeByPrescriptionkey(String prescriptionkey)
    {
        return prescriptiontypeMapper.deletePrescriptiontypeByPrescriptionkey(prescriptionkey);
    }
}
